package com.yiyuan.app.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.guaike.core.mybatis.plugins.BaseDAO;
import com.yiyuan.app.entity.po.UConfManageEquityPO;
import com.yiyuan.app.mapper.UConfManageEquityMapper;
import org.springframework.stereotype.Repository;

@Repository
public class UConfManageEquityDAO extends BaseDAO<UConfManageEquityMapper, UConfManageEquityPO> {


    public UConfManageEquityPO findUserOne(Long userId, Integer month) {
        LambdaQueryWrapper<UConfManageEquityPO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(UConfManageEquityPO::getUserId, userId);
        queryWrapper.le(UConfManageEquityPO::getStartMonth, month);
        queryWrapper.ge(UConfManageEquityPO::getEndMonth, month);
        return getBaseMapper().selectOne(queryWrapper);
    }
}
